<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮点算术不总是 100% 精确</title>
</head>

<body>

    <p>浮点的算数并不总是 100% 精准：</p>
    <p id="demo"></p>
    <script>
        var x = 0.2 + 0.1;
        document.getElementById("demo").innerHTML = "0.2 + 0.1 = " + x;
    </script>
</body>

</html>